package com.mk.plugin.model;

public class ToolbarComponentModel {
    private String type;
    private String fieldName;
    private String labelText;

    public ToolbarComponentModel(String type, String fieldName) {
        this.type = type;

        if (fieldName.contains("|")) {
            String[] split = fieldName.split("\\|");
            this.fieldName = split[0];
            this.labelText = split[1];
        } else {
            this.fieldName = fieldName;
        }
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getLabelText() {
        return labelText;
    }

    public void setLabelText(String labelText) {
        this.labelText = labelText;
    }

    @Override
    public String toString() {
        return "ToolbarComponentModel{" +
                "type='" + type + '\'' +
                ", fieldName='" + fieldName + '\'' +
                ", labelText='" + labelText + '\'' +
                '}';
    }
}
